// OperateTemplate.h: interface for the COperateTemplate class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_OPERATETEMPLATE_H__F158D79A_4903_49E7_B0A5_2FAF0BB5828A__INCLUDED_)
#define AFX_OPERATETEMPLATE_H__F158D79A_4903_49E7_B0A5_2FAF0BB5828A__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "AddInDerivedOperator.h"
class  COperateTemplate : public COperatorCurEditBase
{
protected://protect data

public:
	/*! constructor */
	COperateTemplate(HDiMineView* view,IDMAddIn *addin);;
	~COperateTemplate();
	
//	CBaseOperator * Clone();  /*! returns a pointer to a copy of the operator */
	
							  /*!
							  Returns A pointer to a character string denoting the name of the operator  'Construct NURBS Curve'
	*/
	virtual const char * GetName();  
	
	
	/*!
	OnNoButtonDownAndMove draws a rubberbanded polyline from the previous point in the array to the current mouse 
	position. If the number of points in the array has exceeded the degree of the NURBS curve (default=2) the polyline
	construction segments will already have been replaced with a nurbs curve.  In this case, OnNoButtonDownAndMove 
	replaces the entire construction NURBS curve with an updated version that accounts for the current pointer position.
	\param hevent An dmEventInfo object containing information about the current event.
	\return A value indicating the result of the event handling.
	*/
	int	OnNoButtonDownAndMove(dmEventInfo &hevent);
	
	/*!
	OnLButtonDown records the first mouse position and initiates the polyline-drawing mechanism used in
	HOpConstructPolyline.  When the number of points in the polyline array exceeds the degree of the NURBS curve
	(default=2), OnLButtonDown replaces the construction polyline with a construction NURBS curve.
	\param hevent An dmEventInfo object containing information about the current event.
	\return A value indicating the result of the event handling.
	*/
	int	OnLButtonDown(dmEventInfo &hevent);
	
	/*!
	OnLButtonDblClk directs the final mouse position into the temp array, then inserts the array into the database as a 
	NURBS curve.  This function also takes care of any cleanup.
	\param hevent An dmEventInfo object containing information about the current event.
	\return A value indicating the result of the event handling.
	*/
	int	OnLButtonDblClk(dmEventInfo &hevent);
	
	/*!
	OnMButtonDown passes a middle-button down event to OnLButtonDown.
	\param hevent An dmEventInfo object containing information about the current event.
	\return A value indicating the result of the event handling.
	*/
	virtual int OnRButtonDown(dmEventInfo &hevent);

public:
	virtual int ExcuteCommand(const char* cmdstr);
	virtual int Init();
	/*
	ptCenter the center point of circle
	radious the radious of the circle
	vNormal the normal of plane
	*/
	void DM_EraseTemporaryGraph(BOOL bEnd,BOOL bMove=FALSE);
//	BOOL HC_CalculateArc(const dmSPoint pt1,const dmSPoint pt2,const dmSPoint pt3,double len=0.0);
	int DM_InsetUtilityss(void);
	void Flush();//flust new memory
};
#endif // !defined(AFX_OPERATETEMPLATE_H__F158D79A_4903_49E7_B0A5_2FAF0BB5828A__INCLUDED_)
